import React from 'react';
import * as Icon from '@ant-design/icons';
export function getIcon(iconName: any): React.ReactNode | null {
    if (!iconName) {
        return null;
    }
    // 检查是否为自定义图标字体
    // if (iconName.startsWith('icon-')) {
    //     return () => <IconFont type={iconName} />;
    // }
    const iconMap = Object.keys(Icon).map((key) => key);
    if (!iconMap.includes(iconName)) {
        return null;
    }
    return React.createElement(Icon[iconName], {});
}
